﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using SureKAM.BackUp.Notify.Domain;
using SureKAM.BackUp.Notify.Service.Interfaces;

namespace SureKAM.BackUp.Notify.Service.Test
{
    public class DirectoryServiceTestFixture
    {
        private IDirectoryService _directoryService;

        [TestFixtureSetUp]
        public  void  TestFixtureSetUp()
        {
            _directoryService = new DirectoryService();
        }

        [Test]
        public void  AddTest()
        {
            Notify.Domain.Directory directory=new Directory();
            directory.ID = Guid.NewGuid().ToString();
            directory.Name = "wuhong";
            this._directoryService.Add(directory);
        }

        [Test]
        public  void  DeleteTest()
        {
            Notify.Domain.Directory directory = this._directoryService.GetDirectoryById("d3250385-22e3-4a97-8cc4-14d7855c37fb");
            this._directoryService.Delete(directory);
        }

        [Test]
        public void AddDNMappingTest()
        {
            bool operation = this._directoryService.AddDNMapping("a6ea1b18-1c6d-4b63-a8ea-7aadd0c2bb9d", "00000000-0000-0000-0000-000000000000");
            Assert.IsTrue(operation);
        }

        [Test]
        public void DeleteDNMappingTest()
        {
            bool operation = this._directoryService.DeleteDNMapping("a6ea1b18-1c6d-4b63-a8ea-7aadd0c2bb9d",
                                                                    "00000000-0000-0000-0000-000000000000");
            Assert.IsTrue(operation);
        }
    }
}
